home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / doc / clippings / 911204-01 < prev    next >
Encoding:
Internet Message Format  |  1991-12-04  |  6.2 KB

  1. From: prl@iis.ethz.ch (Peter Lamb)
  2. Newsgroups: alt.security,comp.unix.admin
  3. Subject: Re: NIS and password security
  4. Message-ID: <prl.691873839@iis>
  5. Date: 4 Dec 91 19:10:39 GMT
  6. References: <#hpq#bc@rpi.edu> <KIMMO.SUOMINEN.91Dec4151614@lauri.it.lut.fi>     <r6pqv0k@rpi.edu> <1991Dec4.170052.14839@mp.cs.niu.edu> <KIMMO.SUOMINEN.91Dec4194510@lauri.it.lut.fi>
  7. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  8.  
  9. There have been a number of queries and some not completely accurate
  10. information posted on this question. I'll try to summarise the problem and
  11. suggested workarounds. None of the workarounds is particularly satisfactory,
  12. and I'll try to give a reasonable summary of the pros and cons.
  13.  
  14. The problem is this: ypserv is totally indiscriminate about which machines
  15. it will respond to queries from. Normal NIS maps can be read by anyone 
  16. on the Internet who can route packets to your NIS server and back.
  17. "secure" (HA!) NIS maps like passwd.adjunct can only be read if the querier
  18. is using a privileged port (< 1024). This means that anyone can read your
  19. "secure" maps if they can crack root on some machine on the Internet
  20. and can route packets to your machine.
  21.  
  22. The bug means that many machines on the Internet which use NIS are
  23. vulnerable to having their password files stolen and run through "Crack" or
  24. similar. Arguments about whether distributing Crack and fast U*ix encryption
  25. algorithms was a good idea aside, every wannabe cracker now has a copy
  26. of a reasonably state-of-the-art password guesser.
  27.  
  28. As I said in my earlier post on this subject, the combination "I'm NIS
  29. and I serve everyone" and easily available password guessers has already
  30. led to breakins at some sites.
  31.  
  32. This bug was reported to Sun in April 1990, and CERT has also been aware
  33. of it for about the same length of time.
  34.  
  35. I am told that the bug will be fixed in NIS+ or NIS3.0, or whatever it's
  36. called this week, which I understand will be available in Solaris 2.0.
  37.  
  38.  
  39. What to do about it:
  40.  
  41. 1) The Sun Party Line. "Don't run ypserv on your gateway and disable
  42.    IP forwarding on the gateway". This is commonly known as a
  43.    "firewall" (provided the machine is also in other respects
  44.    reasonably secure) and is probably already done by many commercial
  45.    users of the Internet. It is not the greatest in convenience, and
  46.    most University sysadmins would encounter, lets say, a little user
  47.    resistance. Managing the gateway is also a pain.  Switching off
  48.    `routed' alone, as has been suggested here, is usually insufficient.
  49.    However, provided the security of the firewall is not breached, you
  50.    are safe from this attack, and many others. Instructions on how
  51.    to disable IP forwarding in the kernel are in Sun's Network Admin
  52.    manual.
  53.  
  54. 2) The Lamb Party Line. If you communicate to the outside world through a
  55.    smart router, filter out packets coming from external connections
  56.    addressed to destination ports sunrpc/udp&tcp (port 111) and ports
  57.    600-1023, tcp&udp. This will prevent access to *all* sunrpc services
  58.    from outside the router. It will also block access to the Kerberos
  59.    protocols (probably also not a bad idea given the info. in Steve
  60.    Bellovin's paper about Kerberos security problems), and will
  61.    probably block the BSD `r' (rcp,rlogin, etc) commands, but don't
  62.    count on it doing so.  If you and your router are smart enough, you
  63.    may be able to make the `r' commands work.  Eg, for rlogin, allow
  64.    the packets through iff their source is 513/tcp (this opens up a hole
  65.    for a sufficiently clever cracker, though). Blocking port 111 alone
  66.    is insufficient but will block the most obvious attacks (including
  67.    those I've been told have already actually occurred).
  68.  
  69. The above two solutions are the only real answers to the problem. There
  70. are some workarounds which make life harder for the potential cracker.
  71.  
  72. 1) Choose a hard-to-guess NIS domain name. The cracker must be able to guess
  73.    your NIS domain name in order to talk to ypserv. This is purest security-
  74.    through-obscurity. The domain name is normally only handled by
  75.    automatic systems, and can be up to 64 characters long. Making the first
  76.    part a reasonable handle may help system administration. Something like
  77.     my-old-domainname-Ldp.T2d9wCY
  78.    is probably reasonable. This precaution is vulnerable to "social
  79.    engineering" attacks, ie. the cracker trying to fool a user at your site
  80.    to reveal the domain name, since the NIS domain name can be discovered by
  81.    any user on your machines.
  82.  
  83. 2) Use passwd+ or npasswd to vet passwords. If you do this, you need to
  84.    make all your users put their current password through the new
  85.    password program. Using a premptive check on passwords for idiotic
  86.    usage is a good idea anyway, independent of whether you use NIS or
  87.    not.  If you have Suns and you'd rather spend money than install
  88.    free software, Sun Shield (TM) also provides this capability, along
  89.    with other more or less useful things.  Convex provides some similar
  90.    capabilities in their passwd(1) program.  Some other manufacturers
  91.    may also have similar capabilities. The more sites that do this, the more
  92.    frustrating it will become for crackers trying to guess passwords.
  93.  
  94.  
  95.  
  96. Note that this problem is common to all versions of NIS or Yellow Pages,
  97. that I know of not just on Suns. It will probably go away in NIS+ aka NIS3.0,
  98. but it seems that this will be a little while coming, and for non-Sun
  99. machines even further off.
  100.  
  101. Using NIS in combination with Sun's so-called `C2' security will *not* help.
  102.  
  103. For those not aware of current technology in password guessing programs,
  104. Alan Muffet (?sp) "Crack" program can test > 500 guesses/sec against
  105. a U*ix encrypted password on any modern RISC workstation. This means that 
  106. an encrypted password can be checked against the entire /usr/dict/words
  107. in less than a minute. "Crack" has been posted to the network, and you
  108. can assume that most crackers and wannabe's have a copy.
  109.  
  110.  
  111. Peter Lamb (prl@iis.ethz.ch) (depressed)
  112.  
  113.  
  114. PS: Sorry, I will not respond to requests for more details about how to
  115.     exploit this hole. Sun and CERT have full details. If you have a Sun
  116.     s/w maintenance contract, the escalation SO# was 484666 and the Sun BugId
  117.     was 1036869. Please contact Sun if you feel you need more details.
  118.  
  119.